package edu.xy.myapplication.slice;

import edu.xy.myapplication.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.agp.components.Text;

public class MainAbilitySlice_02 extends AbilitySlice {
    ohos.agp.components.Text text01=null;
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        // 设置该页面所关联的页面布局
        super.setUIContent(ResourceTable.Layout_ability_main_02);

        // 获取text对象
        text01 = (Text)this.findComponentById(ResourceTable.Id_text_02_01);

        // 设置单击事件
        text01.setClickedListener(this::clickedListenerText01);
    }

    private void clickedListenerText01(Component component) {
        text01.startAutoScrolling();

    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}



